﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;
using Sahit.iSoilHotel.Domain.MainBoundedContext.Tavern.Aggregates.CustomerAgg;

namespace Sahit.iSoilHotel.Infrastructure.DataAccess.MainBoundedContext.Tavern.Mapping.Customers
{
    public class CustomerMap:
        EntityTypeConfiguration<Customer>
    {
        public CustomerMap()
        {
            this.ToTable("Customer");
            this.HasKey(c => c.ID);
            this.Property(c => c.IDCard).HasMaxLength(18);
            this.Property(c => c.Mobile).HasMaxLength(11);
            this.Property(c => c.Sex).HasMaxLength(1);

            this.Ignore(c => c.Type);
            this.Property(c => c.TypeID);
        }
    }
}
